//
//  XLGHeadImageDownloadQueue.h
//  etionCBLogic
//
//  Created by wjxfhxy on 14-5-30.
//  Copyright (c) 2014年 GuangZhouXuanWu. All rights reserved.
//

#import <Foundation/Foundation.h>

/**
 *  头像下载队列，专门用于处理列表头像或小头像下载，不做它用
 */

extern NSString *const XLGHeadImageDownloadQueueHeadImageDownloadResultNotification;

extern NSString *const XLGHeadImageDownloadQueueHeadImageDownloadResultResultKey;

extern NSString *const XLGHeadImageDownloadQueueHeadImageDownloadResultURLKey;

extern NSString *const XLGHeadImageDownloadQueueHeadImageDownloadResultPathKey;

@interface XLGHeadImageCache : UIImage

@property(nonatomic,readonly) NSString* filePath;

@end

@interface XLGHeadImageDownloadQueue : NSObject

+(void)initHeadImageDownloadQueue;

+(void)releaseHeadImageDownloadQueue;

+(void)deleteAllQueueHeadImageCache;

+(void)clearAllQueueAll;

@end

@interface XLGHeadImageDownloadQueue (AssignQueue)

+(void)setLocalStorePath:(NSString*)path forKey:(NSString*)key;

+(XLGHeadImageCache*)checkOrStartDownloadHeadImageWhenAddHeadImageURL:(NSString*)headImageURL forKey:(NSString*)key;

+(BOOL)setOrStartDownloadHeadImageWhenAddHeadImageURL:(NSString*)headImageURL inImageView:(UIImageView*)imageView tag:(NSString*)tag forKey:(NSString*)key;

+(NSString*)isHeadImageExist:(NSString*)headImageURL forKey:(NSString*)key;

+(XLGHeadImageCache*)setCacheWithHeadImageURL:(NSString*)headImageURL andHeadImagePath:(NSString*)headImagePath forKey:(NSString*)key;

+(XLGHeadImageCache*)checkDownloadHeadImageWithHeadImageURL:(NSString*)headImageURL forKey:(NSString*)key;

+(void)deleteHeadImage:(NSString*)headImageURL forKey:(NSString*)key;

+(void)deleteAllHeadImageForKey:(NSString*)key;

+(void)clearAllForKey:(NSString*)key;

+(void)clearTag:(NSString*)tag forKey:(NSString*)key;


@end

@interface XLGHeadImageDownloadQueue (DefaultQueue)

+(void)setLocalStorePath:(NSString*)path;

+(XLGHeadImageCache*)checkOrStartDownloadHeadImageWhenAddHeadImageURL:(NSString*)headImageURL;

+(NSString*)isHeadImageExist:(NSString*)headImageURL;

+(XLGHeadImageCache*)setCacheWithHeadImageURL:(NSString*)headImageURL andHeadImagePath:(NSString*)headImagePath;

+(XLGHeadImageCache*)checkDownloadHeadImageWithHeadImageURL:(NSString*)headImageURL;

+(void)deleteHeadImage:(NSString*)headImageURL;

+(void)deleteAllHeadImage;

+(void)clearAll;

@end
